package com.sap.tpcd.policybuilder.policymodel;

/**
 * @author I068988
 * @version 1.0
 * @created 30-sept.-2011 14:12:34
 */
public class DataFiltering extends Policy {

	private PolicyElement action;
	private PolicyElement destination;
	private PolicyElement interfaces;
	private PolicyElement port;
	private PolicyElement protocol;
	private PolicyElement source;

	public DataFiltering() {
		super();
	}

	public DataFiltering(PolicyElement action, PolicyElement destination,
			PolicyElement interfaces, PolicyElement port,
			PolicyElement protocol, PolicyElement source) {
		super();
		this.action = action;
		this.destination = destination;
		this.interfaces = interfaces;
		this.port = port;
		this.protocol = protocol;
		this.source = source;
	}

	/* (non-Javadoc)
	 * @see com.sap.tpcd.policyhandler.Policy#getPolicyName()
	 */
	@Override
	public String getPolicyName() {
		// TODO Auto-generated method stub
		return super.getPolicyName();
	}

	/* (non-Javadoc)
	 * @see com.sap.tpcd.policyhandler.Policy#setPolicyName(java.lang.String)
	 */
	@Override
	public void setPolicyName(String policyName) {
		// TODO Auto-generated method stub
		super.setPolicyName(policyName);
	}

	/* (non-Javadoc)
	 * @see com.sap.tpcd.policyhandler.Policy#getM_PolicyElement()
	 */
	@Override
	public PolicyElement getM_PolicyElement() {
		// TODO Auto-generated method stub
		return super.getM_PolicyElement();
	}

	/* (non-Javadoc)
	 * @see com.sap.tpcd.policyhandler.Policy#setM_PolicyElement(com.sap.tpcd.policyhandler.PolicyElement)
	 */
	@Override
	public void setM_PolicyElement(PolicyElement m_PolicyElement) {
		// TODO Auto-generated method stub
		super.setM_PolicyElement(m_PolicyElement);
	}

	/**
	 * @return the action
	 */
	public PolicyElement getAction() {
		return action;
	}

	/**
	 * @param action
	 *            the action to set
	 */
	public void setAction(PolicyElement action) {
		this.action = action;
	}

	/**
	 * @return the destination
	 */
	public PolicyElement getDestination() {
		return destination;
	}

	/**
	 * @param destination
	 *            the destination to set
	 */
	public void setDestination(PolicyElement destination) {
		this.destination = destination;
	}

	/**
	 * @return the interfaces
	 */
	public PolicyElement getInterfaces() {
		return interfaces;
	}

	/**
	 * @param interfaces
	 *            the interfaces to set
	 */
	public void setInterfaces(PolicyElement interfaces) {
		this.interfaces = interfaces;
	}

	/**
	 * @return the port
	 */
	public PolicyElement getPort() {
		return port;
	}

	/**
	 * @param port
	 *            the port to set
	 */
	public void setPort(PolicyElement port) {
		this.port = port;
	}

	/**
	 * @return the protocol
	 */
	public PolicyElement getProtocol() {
		return protocol;
	}

	/**
	 * @param protocol
	 *            the protocol to set
	 */
	public void setProtocol(PolicyElement protocol) {
		this.protocol = protocol;
	}

	/**
	 * @return the source
	 */
	public PolicyElement getSource() {
		return source;
	}

	/**
	 * @param source
	 *            the source to set
	 */
	public void setSource(PolicyElement source) {
		this.source = source;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((action == null) ? 0 : action.hashCode());
		result = prime * result
				+ ((destination == null) ? 0 : destination.hashCode());
		result = prime * result
				+ ((interfaces == null) ? 0 : interfaces.hashCode());
		result = prime * result + ((port == null) ? 0 : port.hashCode());
		result = prime * result
				+ ((protocol == null) ? 0 : protocol.hashCode());
		result = prime * result + ((source == null) ? 0 : source.hashCode());
		return result;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (!(obj instanceof DataFiltering)) {
			return false;
		}
		DataFiltering other = (DataFiltering) obj;
		if (action == null) {
			if (other.action != null) {
				return false;
			}
		} else if (!action.equals(other.action)) {
			return false;
		}
		if (destination == null) {
			if (other.destination != null) {
				return false;
			}
		} else if (!destination.equals(other.destination)) {
			return false;
		}
		if (interfaces == null) {
			if (other.interfaces != null) {
				return false;
			}
		} else if (!interfaces.equals(other.interfaces)) {
			return false;
		}
		if (port == null) {
			if (other.port != null) {
				return false;
			}
		} else if (!port.equals(other.port)) {
			return false;
		}
		if (protocol == null) {
			if (other.protocol != null) {
				return false;
			}
		} else if (!protocol.equals(other.protocol)) {
			return false;
		}
		if (source == null) {
			if (other.source != null) {
				return false;
			}
		} else if (!source.equals(other.source)) {
			return false;
		}
		return true;
	}

}